< previous page page_133 next page >

Page 133
up the dialog box you use to add all your properties, methods, and events. Enter UpperCase as the name, select the Property and Public radio buttons, and then press OK (see Figure 5.11).
0133-01.jpg
Figure 5.11.
Adding a new property
to the VText control.
Notice that Visual Basic has created two special functions in your UserControl module. The Property Get routine is used to allow others to "get" the value of your published property. The Property Let routine is used to "let" others send you a value to store in the property. For this chapter, you create all your custom control properties this way.
Tip.gif
Visual Basic 5 ships with an ActiveX Control Wizard that helps you create all the properties, methods, and events for your control. Although you'll not be using this wizard in this chapter, you can learn more about this and other aspects of creating custom controls by using the search word "controls" in the Visual Basic Book Online documents.

You need to modify these default routines to match your published properties. The code in Listing 5.14 shows you how to code the Let and Get routines for the UpperCase property.
Type.gifListing 5.14. Coding the Let and Get routines for the UpperCase property.
Public Property Get UpperCase() As Boolean
    UpperCase = m_UpperCase
End Property

Public Property Let UpperCase(ByVal New_UpperCase As Boolean)
    m_UpperCase = New_UpperCase
    PropertyChanged "UpperCase"
End Property

 
< previous page page_133 next page >

If you like this book, buy it!